<!-- eslint-disable prettier/prettier -->
<template>
  <div class="management">
    <div class="manage-header">
      <div class="manage-left">
        <div class="manage-title">值班表管理</div>
      </div>
      <div class="manage-button">
        <a-button class="addBtn" type="normal" @click="onBack">返回</a-button>
      </div>
    </div>
    <div class="manage-content">
      <div class="content-item" v-for="(item, index) of rotaList" :key="index">
        <div class="item-left">
          <svg-icon icon-class="location" class="icon-location" />
        </div>
        <div class="item-right">
          <div class="item-title">{{ item.title }}</div>
          <div class="item-date">{{ item.date }}</div>
          <div class="item-button">
            <span>查看及编辑</span>
            <span @click="onUnFile">取消归档</span>
          </div>
        </div>
      </div>
    </div>

    <div class="manage-footer">
      <span>共443条数据</span>
      <a-pagination
        v-model:current="rec.pager.pageNum"
        v-model:pageSize="rec.pager.pageSize"
        show-size-changer
        show-quick-jumper
        :total="rec.pager.total"
        @change="onShowSizeChange"
        :pageSizeOptions="['10', '20', '40', '100']"
      />
    </div>
  </div>
</template>
<!-- eslint-disable prettier/prettier -->
<script setup lang="ts">
import { ref, createVNode } from "vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { Modal } from "ant-design-vue";

const rotaList = [
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
  {
    title: "2022-2023上学年春季教师日常值班表",
    date: "2023年1月1日-2023年5月11日",
  },
];

const rec = ref({
  pager: {
    pageNum: 1,
    pageSize: 20,
    total: 3000,
  },
});

const onShowSizeChange = () => {};

const onBack = () => {
  history.back();
}

const onUnFile = () => {
  Modal.confirm({
    width: "540px",
    title: "确定取消归档该值班表？",
    content: "取消归档的值班表，值班老师可见，确认取消归档吗？",
    icon: createVNode(ExclamationCircleOutlined),
    async onOk() {
      console.log(123);
    },
    onCancel() {
      console.log("Cancel");
    },
    class: "test",
  });
};
</script>
<style scoped lang="less">
.management {
  width: 1616px;
  height: 828px;
  background: #ffffff;
  border-radius: 10px;
  padding: 0px 24px;
}
.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.manage-left {
  display: flex;
  align-items: center;
}
.manage-button {
  display: flex;
  align-items: center;
}

.manage-title {
  width: 80px;
  height: 64px;
  font-size: 16px;
  font-family: Microsoft YaHei UI, Microsoft YaHei UI-600;
  font-weight: 600;
  text-align: left;
  color: #303233;
  line-height: 64px;
  margin-right: 26.17px;
}

.icon-excla {
  font-size: 11.68px;
  margin-right: 5px;
}

.manage-tip {
  width: 206px;
  height: 18px;
  font-size: 14px;
  font-family: Microsoft YaHei UI, Microsoft YaHei UI-400;
  font-weight: 400;
  text-align: LEFT;
  color: #aaaeb2;
  line-height: 16px;
  letter-spacing: 0.07px;
  white-space: pre;
  display: flex;
  align-items: center;
}

.manage-content {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-height: 680px;
  overflow-y: auto;
}
.content-item {
  width: 512px;
  height: 124px;
  border: 1px solid #ebecf4;
  border-radius: 10px;
  margin-right: 16px;
  margin-bottom: 16px;
  padding: 26px 20px;
  display: flex;
  &:hover {
    width: 512px;
    height: 124px;
    background: #ffffff;
    border: 1px solid #3e77fa;
    border-radius: 10px;
    box-shadow: 0px 6px 10px 0px rgba(13, 61, 172, 0.06);
  }
  &:nth-child(3n) {
    margin-right: 0px;
  }
}

.icon-location {
  width: 36px;
  height: 36px;
  margin-right: 15px;
}

.item-title {
  width: 270px;
  height: 26px;
  font-size: 16px;
  font-family: Microsoft YaHei UI, Microsoft YaHei UI-600;
  font-weight: 600;
  text-align: LEFT;
  color: #303233;
  line-height: 26px;
  white-space: pre;
}
.item-date {
  width: 193px;
  height: 18px;
  font-size: 14px;
  font-family: Arial, Arial-400;
  font-weight: 400;
  text-align: left;
  color: #aaaeb2;
  line-height: 16px;
  margin-top: 4px;
}
.item-button {
  margin-top: 16px;
  height: 20px;
  font-size: 14px;
  font-family: Microsoft YaHei UI, Microsoft YaHei UI-400;
  font-weight: 400;
  text-align: LEFT;
  color: #3e77fa;
  line-height: 20px;
  letter-spacing: 0.07px;
  display: flex;
  span {
    width: 73px;
    height: 20px;
    margin-right: 16px;
    cursor: pointer;
  }
}
.manage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 1568px;
  height: 80px;
  position: absolute;
  bottom: 60px;
}
</style>
